<div id="divMain"><?=form_open(base_url("untitled/loaiphong/sua.html"))?>
    <?php foreach($result as $item) { echo form_hidden("id", $item->id); ?>
	<table align="center" class="tblInsert">
    	<tr>
            <td>Hình sản phẩm:</td>
            <td align="left"><div style="float:left;text-align:center;padding:5px"><?php if($this->files->checkfile('./upload/tin/'.$item->hinh)) { ?><?=anchor(base_url('untitled/upload.html?folder=upload/tin&hinh=1&loai=2&id='.$item->id.'&url='.current_url().'?'.$_SERVER['QUERY_STRING']),"Sửa");?> - <?=anchor(base_url('untitled/xoahinh.html?id='.$item->id.'&loai=tin&url='.current_url().'?'.$_SERVER['QUERY_STRING']),"Xóa");?><br /><img src="<?=base_url('upload/tin/'.$item->hinh)?>" width="100" /> <?php } else { echo anchor(base_url('untitled/upload.html?folder=upload/tin&hinh=1&loai=2&id='.$item->id.'&url='.current_url().'?'.$_SERVER['QUERY_STRING']),"Thêm hình chính");}?></div>
            </td>
        </tr>
    	<tr>
        	<td>Loại tin:<?=form_error('idLT')?></td>
            <td style="text-align:left">
            	<select name="idLT">
                <?php foreach($resultDDL as $items) { ?><option value="<?=$items->id?>" <?=($item->idLT==$items->id)?'selected="selected"':''?>><?=$items->ten?></option><?php } ?>
                </select>
            </td>
        </tr>
    	<tr>
        	<td>Tên:<?=form_error('ten')?></td>
            <td style="text-align:left"><input type="text" name="ten" value="<?=$item->ten?>" /></td>
        </tr>
    	<tr>
        	<td>Thứ tự:<?=form_error('thutu')?></td>
            <td style="text-align:left"><input type="text" name="thutu" value="<?=$item->thutu?>" /></td>
        </tr>
        <tr>
        	<td>Ẩn hiện:<?=form_error('anhien')?></td>
            <td align="left"><select name="anhien"><option <?=($item->anhien==1)?"selected='selected'":""?> value="1">Hiện</option><option <?=($item->anhien==0)?"selected='selected'":""?> value="0">Ẩn</option></select></td>
        </tr>
    	<tr>
        	<td valign="top">Tóm tắt:<?=form_error('tomtat')?></td>
            <td style="text-align:left">
            	<?php $arr = array('name'=>'tomtat','width'=>'500','height'=>'200','value'=>$item->tomtat,'toolbar'=>'Basic'); $this->editor->create($arr);?>
            </td>
        </tr>
    	<tr>
        	<td valign="top">Nội dung:<?=form_error('noidung')?></td>
            <td style="text-align:left">
            	<?php $arr = array('value'=>$item->noidung);  $this->editor->create($arr);?>
            </td>
        </tr>
        <tr>
        	<td colspan="2"><?=form_submit("btnSubmit","Sửa")?></td>
        </tr>
    </table>
    <?php } ?>
    <?=form_close();?>
</div>